import _ from 'lodash'
import printMe from './print.js'
import { cube } from './math.js'

function component() {
  let element = document.createElement('div')
  let btn = document.createElement('button')

  element.innerHTML = _.join(['Hello', 'webpack'], ' ')

  btn.innerHTML = 'Click me and check the console!'
  btn.onclick = printMe

  element.appendChild(btn)

  let pre = document.createElement('pre')
  pre.innerHTML = '5 cubed is equal to ' + cube(5)
  element.appendChild(pre)

  return element
}

document.body.appendChild(component())